@inject('appRepository', 'App\Repositories\AppRepository')
@php
    $banner =  $appRepository->getPictureByColumn(5,['网上服务','网上服务轮播']);
@endphp
@extends('layouts.app')
@section('title','首页')
@section('content')
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
        <div class="carousel-inner">
            @foreach($banner as $key => $item)
                <div class="carousel-item {{$key == 0 ? 'active':""}}">
                    <img class="bd-placeholder-img" width="100%" height="100%"
                         src="{{$item->content_detail->asset?$item->content_detail->asset->path:''}}"
                         preserveAspectRatio="xMidYMid slice" focusable="false"/>

                </div>
            @endforeach
        </div>
    </div>

    <div class="container-fluid py-5 bg-grey">
        <div class="container my-5">
            <p class="service-home-title bg-dark "><em></em>
                <span></span>网上服务</p>
            <div class="mt-5">
                @foreach($contents as $item)
                    <div class="service-content-item">
                        <p class="service-content-title"><i class="iconfont icon-word"></i> {{$item->content_detail->title}}
                        </p>
                        <a class="service-content-link" href="{{url('/content/'.$item->id)}}">
                            浏览
                        </a>
                    </div>
                @endforeach
            </div>
            {{ $contents->links('layouts.page') }}
        </div>
    </div>

@endsection

